#Copyright Tyler Darnell

#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

import businessClasses
import resourceClasses
import random

ironOre = resourceClasses.Resc("irn_ore", 25)
steel = resourceClasses.Resc("steel_rolls",30)

ironOre.getNeed()
ironOre.getPrice()
steel.getNeed()
steel.getPrice()

vein = resourceClasses.RescVein(ironOre,10)

mine = businessClasses.TierOneBusiness(500,75,vein)
sList = [mine]


machineryComp = businessClasses.TierTwoBusiness(1000000,80,ironOre,steel,sList)

print mine.claimed
print machineryComp.hasSupplier
mine.determineProduction()
mine.calcMinSalePrice()
machineryComp.determineProduction()
machineryComp.calcMinSalePrice()

while True:
    mine.produceGoods()
    machineryComp.purchaseGoods()
    machineryComp.produceGoods(sList)
    print "Steel Foundry Value: ", machineryComp.potentialValue
    print "Steel stock: ", machineryComp.outputRes
    raw_input("enter to continue: ")
